import { View } from "../../../../mvc/core/View";
import { ObjCreate } from "../../common/ObjCreate";
import { LayerManager } from "../../../manager/LayerManager";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
//class InterFlowerBtnIcon
    
    export  class InterFlowerBtnIcon extends View
    {
        constructor()
        {
            super();
            if (InterFlowerBtnIcon._instance != null) 
            {
                throw new Error("InterFlowerBtnIcon单例");
            }
            this.showInterFlowerBtn();
            return;
        }

        /* internal  */showInterFlowerBtn(): void
        {
            buttonMode = true;
            this._interFlowerBtn = ObjCreate.createGLoadedButton("InterFlowerIconBtn", 0, 0, 60, 50, this);
            this._interFlowerBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onInterFlowerClickHandler);
            layer = LayerManager.rightTopUILayer;
            return;
        }

        /* internal  */onInterFlowerClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.RankInterFlowerWindowOpen));
            return;
        }

        public static get instance(): InterFlowerBtnIcon
        {
            if (InterFlowerBtnIcon._instance == null) 
            {
                InterFlowerBtnIcon._instance = new InterFlowerBtnIcon();
            }
            return InterFlowerBtnIcon._instance;
        }

        /* internal */ /* var */_interFlowerBtn: GLoadedButton;

        /* internal */ static /* var */_instance: InterFlowerBtnIcon;
    }
